package com.kyhd.audio.dao.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.joda.time.DateTime;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;
import lombok.ToString;

@ToString
@Data
@Entity
@Table(/*schema = "novel",*/ name = "audio_exchange_log"
)
@EntityListeners(AuditingEntityListener.class)
public class AudioExchangeLog {
	
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO) //mysql数据库表ID需设置为auto_increment
  @Column(name = "id", nullable = false, updatable = false)
  private long id;
  
  @Column(name = "content_id", nullable = false, updatable = true
  ,columnDefinition="varchar(50)")
  String contentId;
  
  @Column(name = "content_novel_id", nullable = false, updatable = true
  ,columnDefinition="varchar(10)")
  private String contentNovelId; 
  
  @Column(name = "path", nullable = false, updatable = true)
  private String path;  
  
  @CreatedDate
  @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime")
  @Basic(optional = false)
  @Column(name = "ctime", nullable = false, updatable = false)
  private DateTime ctime;
}
